package com.cloud.job;

import com.cloud.service.LoginService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @version v1.0
 * @author: TianXiang
 * @description: 用户操作
 * @date: 2020/11/30
 */

@Component
public class UserJob {

    private static final Logger LOG = LoggerFactory.getLogger(UserJob.class.getName());

    @Resource
    private LoginService loginService;

    /**
     * 每天凌晨3点校验观影过期时间
     */
    @Scheduled(cron = "0 0 3 * * ?")
    public void execute() {
        LOG.info("校验观影过期时间 开始");
        loginService.expirePermission();
        LOG.info("校验观影过期时间 结束");
    }

}
